package allwe.thread07;

import java.util.concurrent.ArrayBlockingQueue;

public class ArrayBlockingQueueTest {
    public static void main(String[] args) {
        ArrayBlockingQueue<String> arrayBlockingQueue = new ArrayBlockingQueue<>(3);

        try {
            arrayBlockingQueue.put("aaa");
            arrayBlockingQueue.put("bbb");
            arrayBlockingQueue.put("ccc");
            System.out.println(arrayBlockingQueue);
            System.out.println(arrayBlockingQueue.take());
            System.out.println(arrayBlockingQueue);
            arrayBlockingQueue.put("ddd");
            System.out.println(arrayBlockingQueue);


        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

    }
}
